﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess;
using Entity;
using BusinessObject.Interface;

namespace BusinessObject
{
    public class BranchBO : IBranchBO
    {
        private List<Branch> branches;

        public BranchBO(List<Branch> manager)
        {
            this.branches = manager;
        }

        public List<Branch> Branches
        {
            get { return this.branches; }
            set { this.branches = value; }
        }

        public void AddBranch(Branch branch){
            if(branch == null){
                throw new ArgumentNullException("branch");
            }
            
            Branches.Add(branch);
        }

        public void RemoveBranch(Branch branch) {
            if (branch == null) {
                throw new ArgumentNullException("branch");
            }
            Branches.Remove(branch);
        }

        ////phuong thuc add du lieu vao data
        //public bool NewBranch(string brName)
        //{
        //    Branch br = new Branch();
        //    br.BranchName = brName;

        //    BranchDA bDA = new BranchDA();
        //    if (bDA.CreateNew(br))
        //    {
        //        return true;
        //    }
        //    else
        //    {
        //        return false;
        //    }
        //}
    }
}
